USE [NANS21V]
GO

/****** Object:  UserDefinedFunction [dbo].[CommentCodeConvert]    Script Date: 04/24/2014 13:28:07 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[IsRelay]') AND type in (N'FN', N'IF', N'TF', N'FS', N'FT'))
DROP FUNCTION [dbo].[IsRelay]
GO

USE [NANS21V]
GO

/****** オブジェクト: Scalar Function [dbo].[IsRelay] スクリプト日付: 2014/05/08 9:47:39 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

GO
CREATE FUNCTION [dbo].[IsRelay]
(
	@KYOGISYANO int,
	@SYUMOKUKUBUN int
	
)
RETURNS INT
AS
BEGIN
	DECLARE @return int
	IF(@SYUMOKUKUBUN = 4) 
		SET @return = null
	ELSE
		SET @return = @KYOGISYANO
	
	
	RETURN @return
END
